package dialogs;

import java.awt.*;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JScrollPane;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JTextArea;

public class NotePad extends JFrame {
	private JMenuBar mainMenuBar = null;
	private JPanel pane = null;
	private JScrollPane scrollPane = null;
	private JMenu fileMenu = null;
	private JMenuItem openMenuItem = null;
	private JMenuItem saveMenuItem = null;
	private JMenuItem exitMenuItem = null;
	public JTextArea textArea = null;

	/**
	 * This is the default constructor
	 */
	public NotePad() {
		super();
		initialize();
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		this.setSize(300, 200);
		this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); // Generated
		this.setContentPane(getPane()); // Generated
		this.setJMenuBar(getMainMenuBar()); // Generated
		this.setTitle("Note pad");
	}

	/**
	 * This method initializes mainMenuBar
	 * 
	 * @return javax.swing.JMenuBar
	 */
	private JMenuBar getMainMenuBar() {
		if (mainMenuBar == null) {
			mainMenuBar = new JMenuBar();
			mainMenuBar.add(getFileMenu()); // Generated
		}
		return mainMenuBar;
	}

	/**
	 * This method initializes pane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getPane() {
		if (pane == null) {
			pane = new JPanel();
			pane.setLayout(new BorderLayout()); // Generated
			pane.add(getScrollPane(), java.awt.BorderLayout.CENTER); // Generated
		}
		return pane;
	}

	/**
	 * This method initializes scrollPane
	 * 
	 * @return javax.swing.JScrollPane
	 */
	private JScrollPane getScrollPane() {
		if (scrollPane == null) {
			scrollPane = new JScrollPane();
			scrollPane.setViewportView(getTextArea()); // Generated
		}
		return scrollPane;
	}

	/**
	 * This method initializes fileMenu
	 * 
	 * @return javax.swing.JMenu
	 */
	private JMenu getFileMenu() {
		if (fileMenu == null) {
			fileMenu = new JMenu();
			fileMenu.setText("File"); // Generated
			fileMenu.setMnemonic(java.awt.event.KeyEvent.VK_F); // Generated
			fileMenu.add(getOpenMenuItem()); // Generated
			fileMenu.add(getSaveMenuItem()); // Generated
			fileMenu.addSeparator();
			fileMenu.add(getExitMenuItem()); // Generated
		}
		return fileMenu;
	}

	/**
	 * This method initializes openMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getOpenMenuItem() {
		if (openMenuItem == null) {
			openMenuItem = new JMenuItem();
			openMenuItem.setText("Open"); // Generated
			openMenuItem.setMnemonic(java.awt.event.KeyEvent.VK_O); // Generated
		}
		return openMenuItem;
	}

	/**
	 * This method initializes saveMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getSaveMenuItem() {
		if (saveMenuItem == null) {
			saveMenuItem = new JMenuItem();
			saveMenuItem.setMnemonic(java.awt.event.KeyEvent.VK_S); // Generated
			saveMenuItem.setText("Save"); // Generated
		}
		return saveMenuItem;
	}

	/**
	 * This method initializes exitMenuItem
	 * 
	 * @return javax.swing.JMenuItem
	 */
	private JMenuItem getExitMenuItem() {
		if (exitMenuItem == null) {
			exitMenuItem = new JMenuItem();
			exitMenuItem.setMnemonic(java.awt.event.KeyEvent.VK_X); // Generated
			exitMenuItem.setText("Exit"); // Generated
		}
		return exitMenuItem;
	}

	/**
	 * This method initializes textArea
	 * 
	 * @return javax.swing.JTextArea
	 */
	public JTextArea getTextArea() {
		if (textArea == null) {
			textArea = new JTextArea();
		}
		return textArea;
	}
}
